#-*-coding:UTF-8 -*-
import socket,os
s=socket.socket()
host='192.168.1.191'
#port =12345
port =8081
s.bind((host,port))
s.listen(10)

while True:
    c,addr=s.accept()
    c.send('Welocome Login'.encode())
    # print(c.recv(1024))
    while 1:
        cc=c.recv(1024)
        # print(cc)
        c.send(cc)

        while True:
            cc=c.recv(1024)
            if cc=='cmd':
                while True:
                    cc=c.recv(1204)
                    x=os.system(cc)
                    if x==0:
                        c.send(u'mingzhi')
            else:
                print(cc)
                xx=input(u'server:')
                c.send(xx)
                print(c.recv(1024))